package lesson

import (
	"context"
	"server/internal/model"
	"server/internal/service"

	"server/api/lesson/user"
)

func (c *ControllerUser) Login(ctx context.Context, req *user.LoginReq) (res *user.LoginRes, err error) {
	res = new(user.LoginRes)
	res.Token, err = service.LessonUser().Login(ctx, model.LessonUserLoginInput{
		Phone:    req.Phone,
		Password: req.Password,
	})
	return
}
